/**
 * @class   wosh::gui::wCore_Message
 * @brief   Graphical interface of wosh::Message
 *          
 *          
 *
 ****************************************************************************
 * @version $Id: wCore_Message.h 2458 2010-05-12 05:22:46Z alex $
 * @author  Alessandro Polo
 ****************************************************************************/
/* Copyright (c) 2007-2010, WOSH - Wide Open Smart Home 
 * by Alessandro Polo - OpenSmartHome.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the OpenSmartHome.com WOSH nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Alessandro Polo ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Alessandro Polo BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ****************************************************************************/

#ifndef __WOSH_Gui_Widgets_Core_Message_H__
 #define __WOSH_Gui_Widgets_Core_Message_H__

 #include <framework/gui/IWidgetSerializable.h>
 #include <QtGui/QWidget>
 #include <QAbstractListModel>


 #include <core/Fact.h>
 #include <core/Message.h>
 #include <core/Request.h>
 #include <core/Response.h>
 #include <core/SecurityToken.h>
namespace Ui {
 class wCore_Fact;
 class wCore_Message;
 class wCore_Request;
 class wCore_Response;
 class wCore_SecurityToken;
};
class QLabel;

namespace wosh {
 namespace gui {


class wCore_Message :	public QWidget,
						public virtual IWidgetSerializableT<wosh::Message>
 {
    Q_OBJECT

	WOSH_WIDGET_SERIALIZABLE(wosh::gui::wCore_Message)

	public:
		wCore_Message(QWidget *parent = 0);
		virtual ~wCore_Message();

	public slots:
		WRESULT loadObject( const wosh::Message* message );
		WRESULT saveObject( wosh::Message* message ) const;

	protected:
		void changeEvent(QEvent *e);

	private:
		Ui::wCore_Message *m_ui;

}; // class def


// ----------------------------------------------------------------------------------------


class wCore_Fact :	public QWidget,
					public virtual IWidgetSerializableT<wosh::Fact>
 {
    Q_OBJECT

	WOSH_WIDGET_SERIALIZABLE(wosh::gui::wCore_Fact)

	public:
		wCore_Fact(QWidget *parent = 0);
		virtual ~wCore_Fact();

	public slots:
		WRESULT loadObject( const wosh::Fact* fact );
		WRESULT saveObject( wosh::Fact* fact ) const;

	protected:
		void changeEvent(QEvent *e);

	private:
		Ui::wCore_Fact *m_ui;

}; // class def


// ----------------------------------------------------------------------------------------


class wCore_Request :	public QWidget,
						public virtual IWidgetSerializableT<wosh::Request>
 {
    Q_OBJECT

	WOSH_WIDGET_SERIALIZABLE(wosh::gui::wCore_Request)

	public:
		wCore_Request(QWidget *parent = 0);
		virtual ~wCore_Request();

	public slots:
		WRESULT loadObject( const wosh::Request* request );
		WRESULT saveObject( wosh::Request* request ) const;

	protected:
		void changeEvent(QEvent *e);

	private:
		Ui::wCore_Request *m_ui;

}; // class def


// ----------------------------------------------------------------------------------------


class wCore_Response :	public QWidget,
						public virtual IWidgetSerializableT<wosh::Response>
 {
    Q_OBJECT

	WOSH_WIDGET_SERIALIZABLE(wosh::gui::wCore_Response)

	public:
		wCore_Response(QWidget *parent = 0);
		virtual ~wCore_Response();

	public slots:
		WRESULT loadObject( const wosh::Response* response );
		WRESULT saveObject( wosh::Response* response ) const;

	protected:
		void changeEvent(QEvent *e);

	private:
		Ui::wCore_Response *m_ui;

IWidgetSerializable* data_gui;
QLabel* data_gui_missing;

}; // class def


// ----------------------------------------------------------------------------------------

class wCore_SecurityToken :	public QWidget,
							public virtual IWidgetSerializableTA<wosh::SecurityToken>
 {
    Q_OBJECT

	WOSH_WIDGET_SERIALIZABLE(wosh::gui::wCore_SecurityToken)

	public:
		wCore_SecurityToken(QWidget *parent = 0);
		virtual ~wCore_SecurityToken();

	public slots:
		WRESULT loadObject( const wosh::SecurityToken* token );
		WRESULT saveObject( wosh::SecurityToken* token ) const;

	protected:
		void changeEvent(QEvent *e);

	private:
		Ui::wCore_SecurityToken *m_ui;

}; // class def

// ----------------------------------------------------------------------------------------















 }; // namespace gui
}; // namespace wosh


#endif //__WOSH_Gui_Widgets_Core_Message_H__
